class Answer:
    def __init__(self):
        self.error = 0  # 0: 正确, 1: 编译错误, 2: 运行错误, 3: 题目不存在, 4: 提交不合法
        self.reason = ""
        self.stdout = ""
        self.stderr = ""

    def to_dict(self):
        return {
            "error": self.error,
            "reason": self.reason,
            "stdout": self.stdout,
            "stderr": self.stderr
        }